package com.gitee.loyo.interfaces

import junit.framework.TestCase
import com.gitee.loyo.TUser
import com.gitee.loyo.interfaces.impl.SelectSQL
import org.junit.Test

class SelectListTest : TestCase(){

    @Test
    fun test(){
        val tUser = TUser(1L, "sam", null, null)
        val selectSQL = SelectSQL(tUser)
        assertEquals("select * from t_user where user_id = ? and user_name = ?", selectSQL.getSQL())
        assertEquals(2, selectSQL.getParameters().size)
        assertEquals(tUser.userId, selectSQL.getParameters()[0])
        assertEquals(tUser.userName, selectSQL.getParameters()[1])
    }
}